<?php

class AddressController extends BaseController{
	function getCountries($countryName){
		$result = Country::where('country_name', 'LIKE', '%'.$countryName.'%')->get();
		return Response::json($result);
	}
	function getCities($countryID){
		$result = Country::find($countryID)->cities;
		return Response::json($result);
	}
	function getDistricts($cityID){
		$result = City::find($cityID)->districts;
		return Response::json($result);
	}
	function getTowns($districtID){
		$result = District::find($districtID)->towns;
		return Response::json($result);
	}
	function getStreets($townID){
		$result = Town::find($townID)->streets;
		return Response::json($result);
	}
}